home *** CD-ROM | disk | FTP | other *** search
- /* This program will take an EXEC PC file listing and add the comment in
- that list to the ZIP file in the local subdirectory matching that name.
- This way you can have PKUNZIP give you a brief summary of what the file
- contains by using 'PKUNZIP /v filename.zip sdfsdfs' where sdfsdfs is a
- garbage name that won't match anything. This program written by
- Mike Fleischmann on 11/28/90 with Microsoft C 6.0 and is hereby placed
- into the public domain. I would like it if you left my name as the orgional
- writer of this software.
- */
-
- #include <stdio.h>
- #include <string.h>
- #include <dos.h>
-
- char line[120];
- FILE *list,*name;
-
- main(argc,argv)
- int argc;
- char *argv[];
- {
- int i,j,k;
- char *cptr;
- struct find_t dbuff;
- char str[70];
-
- if(argc<2 || argv[1][0]=='?')
- {
- printf("Calling format is 'ADDCOMNT filename.lst'\n");
- printf("Where filename.lst is an EXEC PC format file description from the\n");
- printf("file list. (I just did an ascii capture) See sample file that came\n");
- printf("with this package for format example\n\n");
- printf("This program will take an EXEC PC file listing and add the comment in\n");
- printf("that list to the ZIP file in the local subdirectory matching that name.\n");
- printf("This way you can have PKUNZIP give you a brief summary of what the file\n");
- printf("contains by using 'PKUNZIP /v filename.zip sdfsdfs' where sdfsdfs is a\n");
- printf("garbage name that won't match anything. This program written by\n");
- printf("Mike Fleischmann on 11/28/90 with Microsoft C 6.0 and is hereby placed\n");
- printf("into the public domain. I would like it if you left my name as the orgional\n");
- printf("writer of this software.\n");
- printf("I can be reached on EXEC PC under the name of OPTICAL PUBLISHING\n\n\n");
- exit(0);
- }
-
- list=fopen(argv[1],"r");
- if(list==NULL)
- {
- printf("couldn't open %s\n",argv[1]);
- exit(0);
- }
-
- fgets(line,120,list);
- while(!feof(list))
- {
- line[12]=0;
- cptr=strchr(line,'.');
- cptr++;
- if(memcmp(cptr,"ZIP",3)==0)
- {
- i=_dos_findfirst(line,_A_NORMAL,&dbuff);
- if(i==0) /* if the file is there */
- {
- name=fopen("name","w");
- fprintf(name,"%s",&line[27]);
- fclose(name);
- printf("\n %s -- %s",line, &line[27]);
- sprintf(str,"pkzip /z %s < name >NUL",line);
- system(str);
- }
- }
- fgets(line,120,list);
- }
- fclose(list);
- }
-